package org.example.design.designmode.singleton;

/**
 * @Auther: lingshi
 * @Date: 2020/5/10 17:09
 * @Description: 懒汉模式
 * 优点:避免了内存开销问题
 * 缺点：线程不安全
 */
public class IdlerSingleton {


    private  static IdlerSingleton idler ;

    private IdlerSingleton(){}

    public  static IdlerSingleton getInstance(){
        if(idler==null){
            idler = new IdlerSingleton();
        }

        return idler;
    }

}
